import sql


def show_groups():
    groups = sql.show_groups()
    for i in range(len(groups)):
        ds = groups[i][2].split(',')
        dns = ''
        for j in range(len(ds)):
            dn = sql.get_device(ds[j])
            if j == 0:
                dns += dn[1]
            else:
                dns += ',' + dn[1]
        groups[i] += (dns,)
    print(groups)
    return groups
